<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>徽虫争鸣</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="x-ua-compatible" content="IE=edge" >
		<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
		<link rel="stylesheet" type="text/css" href="__STATIC__/css/wap/reset.css"/>
		<link rel="stylesheet" href="//g.alicdn.com/de/prismplayer/2.7.0/skins/default/aliplayer-min.css"/>

		<link rel="stylesheet" href="//g.alicdn.com/de/prismplayer/2.7.2/skins/default/aliplayer-min.css" />
		<script type="text/javascript" charset="utf-8" src="//g.alicdn.com/de/prismplayer/2.7.2/aliplayer-min.js"></script>

		<link rel="stylesheet" type="text/css" href="__STATIC__/css/wap/common.css"/>
		<link rel="stylesheet" type="text/css" href="__STATIC__/css/wap/video.css"/>
	</head>
	<body>
		<div class="mainWrap">
			<div class="header">
				<a class="turnBackBtn" href=""><img src="__STATIC__/images/icon_turnBack.png"/></a>
				<h3>视频中心</h3>
			</div>

			<div class="prism-player" id="player-con"></div>

			<div class="" style="text-align: center">
				<span style="font-size: .5rem;">余额：{$user.score}鲜花</span>
			</div>
			<div class="operateWrap">
				<button class="btnItem" id="presentBtn">赠送</button>
			</div>
		</div>
		<div class="presentAlert" id="model" style="display: none">
			<div class="inputBox">
				<label for="friendid">接收人：</label>
				<input type="text" name="" id="friendid" value="" placeholder="请输入好友用户名"/>
			</div>

			<div class="inputBox">
				<label for="score">赠送金币：</label>
				<input type="number" name="" id="score" value="" placeholder="请输入赠送的金币"/>
			</div>

			<div class="operateWrap">
				<button class="confirmBtn">确定</button>
				<button class="cancelBtn">取消</button>
			</div>
		</div>
	</body>
	<script src="__ROOT__/lib/rem.js" type="text/javascript"></script>
	<script src="__ROOT__/lib/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
	<script src="__ROOT__/lib/layer/2.4/layer.js" type="text/javascript"></script>


	<script type="text/javascript">
		$(function(){
			var presentAlertBox = "";
			$("#presentBtn").on("click",function(){
				presentAlertBox = layer.open({
					title: '赠送',
					type: 1,
					closeBtn: 1, //不显示关闭按钮
					offset:'auto',
					shift: 0, //0-6,动画显示 -1:不显示动画 
					shadeClose: true, //开启遮罩关闭
					area: ['80%', '4.0rem'],
					fix: true, //不固定
					content: $('#model')
				});
			})
			
			
			
			$(".cancelBtn").on("click",function(){
				layer.close(presentAlertBox);
			})

			$(".confirmBtn").on("click",function () {
				$.post(
                    '{:url("trade/giveTofriends")}',
                    {friendid:$("#friendid").val(),score:$("#score").val()},
					function (data) {
                        layer.msg(data.error);
						setTimeout(function () {
							window.location.reload();
                        },1000);
                    }
				)
            })

		})
	</script>
	<script>
        var player = new Aliplayer({
                "id": "player-con",
                "source": "http://test.luohuzhan.cn/livw/main.m3u8",
                "width": "100%",
                "height": "250px",
                "autoplay": true,
                "isLive": true,
                "rePlay": false,
                "playsinline": true,
                "preload": true,
                "controlBarVisibility": "hover",
                "useH5Prism": true,
                "skinLayout": [
                    {
                        "name": "bigPlayButton",
                        "align": "blabs",
                        "x": 30,
                        "y": 80
                    },
                    {
                        "name": "H5Loading",
                        "align": "cc"
                    },
                    {
                        "name": "errorDisplay",
                        "align": "tlabs",
                        "x": 0,
                        "y": 0
                    },
                    {
                        "name": "infoDisplay"
                    },
                    {
                        "name": "tooltip",
                        "align": "blabs",
                        "x": 0,
                        "y": 56
                    },
                    {
                        "name": "thumbnail"
                    },
                    {
                        "name": "controlBar",
                        "align": "blabs",
                        "x": 0,
                        "y": 0,
                        "children": []
                    }
                ]
            }, function (player) {
                console.log("播放器创建了。");
            }
        );
	</script>
</html>
